home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 011 / adikit.arc / SINGLE.LSP < prev    next >
Lisp/Scheme  |  1986-12-01  |  10KB  |  293 lines

  1.  
  2.  
  3. (dssetup)
  4. (print "                                      ")
  5. (print "* * * SINGLE SCREEN test program * * *")
  6. (print "                                      ")
  7.  
  8. ; open test result output file...name NNNdisp.lay
  9. (setq testfn (strcat disp8 "." status comnd menu))
  10. (startestout testfn)
  11.  
  12. (terpri)
  13. (print "When the command prompt is only one line or is configured OFF,")
  14. (print "test questions will be asked from the TEXT screen.")
  15. (print "So, if you need to look at the graphics screen again, ")
  16. (print "or the text screen, use flipscreen BEFORE answering the question")
  17. (terpri)
  18. (print "Yes/No questions must be answered with 'y' 'Y' 'n' or 'N'")
  19. (print "Any other response will result in the prompt being repeated")
  20. (terpri)
  21. (print "When a prompt says Hit RETURN, you can only continue by")
  22. (print "depressing the RETURN key")
  23. (terpri)
  24. (print "* * Hit RETURN when ready to go * *")
  25. (getstring cr)
  26.  
  27. ; the first test should check that config of status, comnd and menu worked
  28.  
  29. (if (= "Y" comnd) (graphscr) (textscr))
  30.  
  31. (starttest "First check configuration of COMMAND prompt area")
  32. (if (= "Y" comnd)
  33.     (getrslt "There is a COMMAND prompt area, right? ")
  34.     (getrslt "There is NO Command Prompt Area, correct? "))
  35. (starttest "Next, check for STATUS LINE")
  36. (if (= "Y" status)
  37.     (getrslt "There is a STATUS LINE, right? ")
  38.     (getrslt "There is NO Status line, correct? "))
  39. (starttest "Finally, check for MENU AREA")
  40. (if (= "Y" menu)
  41.     (getrslt "There is a MENU AREA, right? ")
  42.     (getrslt "There is NO Menu area, correct? "))
  43.  
  44. (textscr)
  45. (terpri)
  46. (print "The BORDER tests start by drawing a pline around the dwg area border")
  47. (print "then messing around with it and asking if all is ok.")
  48.  
  49. (starttest "The first step DRAWs a PLINE on the edges of the drawing area.")
  50. ; draw the pline and ask about it
  51. ; assume 0,0 is at lower right of screen so viewctr can be used to
  52. ; compute the corners (2 times x and y values of viewctr)
  53. (setq ctrpt (getvar "viewctr"))
  54. (setq x (car ctrpt))
  55. (setq y (cadr ctrpt))
  56. (setq x (* 2 x))
  57. (setq y (* 2 y))
  58. (command "pline" '(0 0)  "w"  0  0          
  59.                  (list x 0)
  60.                  (list x y)
  61.                  (list 0 y) 
  62.                  (list 0 0) 
  63.                  ctrpt
  64.                   ""
  65. )
  66. (getrslt "Did the PLINE cover the graphics screen edges? ")
  67.  
  68. ;flip to graphics and back to text - ask if all is ok
  69. (terpri)
  70. (starttest "Now, check that FLIPSCREEN doesn't mess things up.")
  71. (textscr)
  72. (wait wtime)
  73. (graphscr)
  74. (getrslt "Did the pline and all of the graphics re-appear? ")
  75.  
  76. ; and one more question...did textscreen leave all that text around?
  77. (starttest "Make sure that the TEXTSCREEN has a screen full of test")
  78. ; make sure we go to textscreen always!
  79. (textscr)                  
  80. (wait wtime)
  81. (getrslt "Does the TEXT screen show the correct # of LINES? (a screen full)")
  82.  
  83. ;make sure GRID works
  84. (starttest "Make sure GRID works")
  85. (command "GRID" "on")
  86. (getrslt "Did the GRID come on? ")
  87.  
  88. (starttest "Now let's turn GRID off")
  89. (command "GRID" "off")
  90. (getrslt "Did the GRID turn off? ")
  91.  
  92. ;turn the axis on. ask if all is ok
  93. (starttest "Now, check that AXIS ON works ok")
  94. (command "axis" ".5")
  95. (getrslt "Did the axis show up correctly? ")
  96.           
  97. ;make sure flipscreen doesn't lose the axis
  98. (starttest "Make sure flip screen doesn't lose the axis")
  99. (wait 250)
  100. (textscr)
  101. (wait 250)
  102. (graphscr)
  103. (getrslt "Did the AXIS stay after the FLIP SCREENS? ")
  104.  
  105. ;change the axis spacing...
  106. (starttest "Next, check that changed axis spacing doesn't leave old ticks")
  107. (wait 1000)
  108. (command "axis" "2.2")
  109. (getrslt "Did the old axis ticks go away, and only the new ones appear? ")
  110.  
  111. ;turn the axis off. ask if all is ok
  112. (starttest "Now, check that AXIS OFF works ok")
  113. (command "axis" "off")
  114. (getrslt "Did the axis go away correctly? ")
  115.  
  116. ;make sure erase highligts the pline. but cancel the erase 
  117. ;we need the pline for later.
  118. (starttest "Next, check that the PLINE HIGHLIGHTS when erased.")
  119. (command "erase"  "l" (slowpick))
  120. ; cancel before its done
  121. (command) 
  122. (getrslt "Did the PLINE HIGHLIGHT? ")
  123.  
  124. ;make sure erase works
  125. (starttest "Next, fully ERASE the PLINE (we won't cancel the erase)")
  126. (command "erase" "l" "")
  127. (getrslt "Did the PLINE, and only the pline, ERASE completely? ")
  128.  
  129. ;make sure oops works...
  130. (starttest "Make sure OOPS brings the PLINE back")
  131. (command "oops")
  132. (getrslt "Did the whole PLINE re-appear? ")
  133.  
  134. ;make the pline into a wide pline
  135. (starttest "Now, let's make a WIDE PLINE.")
  136. (graphscr)
  137. (wait 200)
  138. (command "pedit"  "l" "w" "1" "")
  139. (getrslt "Does the WIDE PLINE show up properly? ")
  140.  
  141. (starttest "Next check that the WIDE PLINE HIGHLIGHTS correclty")
  142. (command "erase" "l" (slowpick))
  143. (command)
  144. (getrslt "Did the WIDE PLINE HIGHLIGHT completely? ")
  145.  
  146. (starttest "Next check that the WIDE PLINE ERASEs completely.")
  147. (command "erase" "l" "")
  148. (getrslt "Did the WIDE PLINE ERASE completely, without erasing other stuff? ")
  149.  
  150. ;now lets check highlighting of a wide pline drawn on top of it self...
  151. (starttest "Next check that a WIDE HORIZONTAL PLINE drawn back on itself HIGHLIGHTS ok")
  152. (command "pline" (getvar "viewctr") "w" "1" "1" "@4<0" "@2<180" "")
  153. (wait 200)
  154. (command "erase" "l" (slowpick))
  155. (command)
  156. (getrslt "Did the pline highlight properly? ")
  157.  
  158. ; now lets do an erase last from the textscr
  159. (starttest "Now check if ERASE L from TEXTSCR works ok")
  160. (textscr)
  161. (command "erase" "l" "")
  162. (graphscr)
  163. (getrslt "Did the pline get erased completely? ")
  164.  
  165. (starttest "Now check that wide arced plines (DONUTs) DRAW correctly")
  166. ; use donut command....
  167. (setq x (* 2 (car ctrpt)))
  168. (setq y (* 2 (cadr ctrpt)))
  169. (setq id (/ (getvar "viewsize") 2))
  170. (setq od (min x y))
  171. (command "donut" id od ctrpt "")
  172. (getrslt "Did the DONUT draw properly? ")
  173.  
  174. (starttest "Now check that the DONUT HIGHLIGHTS completely")
  175. (command "erase" "l" (slowpick))
  176. (command)
  177. (getrslt "Did the DONUT HIGHLIGHT completely? ")
  178.  
  179. (starttest "And now let's check if the DONUT ERASEs completely")
  180. (command "erase" "l" "")
  181. (wait wtime)
  182. (getrslt "Did the DONUT ERASE completely? ")
  183.  
  184. ;now make sure redraw doesn't mess things up
  185. (starttest "Let's put the PLINE and DONUT back, then do a REDRAW")
  186. ;put the donut back
  187. (command "oops")
  188. (wait 200)
  189. ;put the pline in
  190. (setq ctrpt (getvar "viewctr"))
  191. (setq x (car ctrpt))
  192. (setq y (cadr ctrpt))
  193. (setq x (* 2 x))
  194. (setq y (* 2 y))
  195. (graphscr)
  196. (command "pline" (list 0 0) 
  197.                  (list x 0)
  198.                  (list x y)
  199.                  (list 0 y) 
  200.                  (list 0 0) 
  201.                   ctrpt ""
  202. )
  203. (wait 200)
  204. (print "REDRAW")
  205. (wait 200)
  206. (command "redraw")
  207. (getrslt "Did the REDRAW work correctly? ")
  208.  
  209. ;make sure regen works to...
  210. (starttest "Now we'll to a REGEN")
  211. (command "regen")
  212. (getrslt "Did the REGEN work ok? ")
  213.  
  214. ;get rid of the pline  and the donut
  215. (command "erase" "l" "")
  216. (command "erase" "l" "")
  217.  
  218. ; check status line with SNAP, ORTHO
  219. (if (= "Y" status)
  220.     (progn
  221.     (starttest "Check STATUS line after SNAP, ORHTO on")
  222.     (command "snap" "on")
  223.     (wait 250)
  224.     (command "ortho" "on")
  225.     (getrslt "Did SNAP, ORTHO get set in status line? ") 
  226.  
  227. ; make sure flip screen doesn't lose them or the coords
  228.     (starttest "Check flip screen doesn't loose SNAP & ORTHO, and Coordinates")
  229.     (textscr)
  230.     (graphwait)
  231.     (getrslt "Did SNAP, ORTHO and the Coordinates appear in status line? ")
  232.  
  233. ; get rid of them
  234.     (starttest "Turn off SNAP and ORTHO")
  235.     (command "snap" "off")
  236.     (wait 250)
  237.     (command "ortho" "off")
  238.     (getrslt "Did SNAP and ORTHO get taken out of status line? ")
  239.  
  240. ; check that layer shows up in the status line
  241.     (starttest "Change the LAYER.  Does the status line show the layer? ")
  242.     (command "layer"  "new" "new" "set" "new" "")
  243.     (getrslt "Did Layer 'NEW' show up in status line? ")
  244.     (command "layer"  "s" "0")
  245.     (command)
  246.     )  
  247. ; end that progn
  248.     )
  249. ; and that if
  250.  
  251. ; if prompt area
  252. (if (= "Y" comnd)
  253.     (progn
  254.     ;check a long prompt like pline
  255.     (starttest "Now check that a long prompt fits in the command prompt area")
  256.     (setvar "cmdecho" 1)
  257.     (command "pline" (getvar "viewctr"))
  258.     (command)
  259.     (setvar "cmdecho" 0)
  260.     (getrslt "Did the Pline prompt fit in the command prompt area? ")
  261.  
  262. ;now let's make sure at least 3 lines show up in command prompt area
  263.     (starttest "Make sure command prompt area scrolls")
  264.     (print "line 1 line 1 line 1 line 1 line 1 line 1 line 1 line 1 line 1 line 1")
  265.     (print "line 2 line 2 line 2 line 2 line 2 line 2 line 2 line 2 line 2 line 2")
  266.     (print "line 3 line 3 line 3 line 3 line 3 line 3 line 3 line 3 line 3 line 3")
  267.     (getrslt "Were there 3 lines in the command prompt area? ") 
  268.  
  269. ; check HIDE scrolling
  270.     (starttest "Make sure 'Removing hidden lines #' doesn't get in graphics area")
  271. ; insert a hide dwg, zoom e and hide it
  272.     (command "insert"  "hide" "0,0" "1" "1" "0")
  273.     (command "zoom" "e")                  
  274.     (wait 250)
  275.     (command "vpoint" "1,2,3")
  276.     (command "hide")
  277.     (getrslt "Did hidden lines message stay out of drawing area? ")
  278.     (command "vpoint" "0,0,1")
  279.     (command "erase" "w"  (getvar "extmin") (getvar "extmax") "")
  280. ; end that progn of if prompt area
  281.     )
  282. ; and that if
  283.     )
  284.  
  285. ;!!!!!! now make sure zoom w doesn't mess anything up
  286. ;draw some horizontal lines on right hand side of screen
  287. ;and zoom in on them...this is only meaningful for menu area off?
  288.  
  289.  
  290. ; INTERACTIVE TESTS:
  291.  
  292. (load "int")
  293.